package com.Pure;

//import javax.microedition.khronos.opengles.GL10;

//import com.e3roid.E3Engine;
import com.e3roid.drawable.*;
import com.e3roid.drawable.texture.Texture;
import android.graphics.Point;
enum PureLightDirection{
	LD_UP,
	LD_DOWN,
	LD_LEFT,
	LD_RIGHT,
	LD_NONE
};

public class PureLightRay extends PureGameObject {
	
	private float rayLength;
	private float rayWidth;
	
	private Point startPt;
	private int gridDistance;
	
	//private boolean isInitial = false;
	private PureLightDirection direction;
	
	public PureLightRay(Sprite s)
	{
		super(s);
		direction = PureLightDirection.LD_RIGHT;
	}
	public PureLightRay(Sprite s,Point startPt,int gridDistance,PureLightDirection d)
	{
		super(s);
		direction = d;
		this.startPt = startPt;
		this.gridDistance = gridDistance;
		setDirection(d);
	}
	//public void setInitial(boolean b){isInitial = b;}
	//public boolean getInitial(){return isInitial;}
	public PureLightDirection getDirection(){return direction;}
	public void setDirection(PureLightDirection d)
	{
		direction = d;
		switch(d)
		{
			case LD_UP:
				sprite.rotate(-90);
			break;
			case LD_DOWN:
				sprite.rotate(90);
			break;
			case LD_LEFT:
				sprite.rotate(180);
			break;
			case LD_RIGHT:
				sprite.rotate(0);
			break;
			
		}
	}
	public static Point nextStep(Point end,PureLightDirection dir)
	{
		
		switch(dir)
		{	
			case LD_UP:
				end.y--;
			break;
			case LD_DOWN:
				end.y++;
			break;
			case LD_LEFT:
				end.x--;
			break;
			case LD_RIGHT:
				end.x++;
			break;
			
		}
		return end;
	}
	
	
}
